package testdemo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-04-10
 * Time: 14:46
 */
public class Aninmal {
    String name ;
    int age ;

    public Aninmal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public boolean equals(Object obj) {
        if(this == obj) {
            return true;
        }
        if(obj == null || getClass() != obj.getClass()) {
            return false;
        }
        Aninmal o = (Aninmal) obj;
        if( age == o.age  && this.name.equals(o.name)) {
            return true;
        }
        return false;
    }
}
